local que_zhaohua = fk.CreateSkill {
    name = "que_zhaohua",
    tags = { Skill.Wake },
}

Fk:loadTranslationTable {
    ["que_zhaohua"] = "昭华",
    [":que_zhaohua"] = "觉醒技，准备阶段，若你记录了全部四种花色，你减少一点体力上限并失去〖幻梦〗，获得四种花色的牌各一张(若存活角色数不大于4，则记录三种花色即可)。",

    ["@@zhaohua"] = "昭华",
}

que_zhaohua:addEffect(fk.EventPhaseStart, {
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(que_zhaohua.name) and
            player.phase == Player.Start and #player:getTableMark("@que_huanmeng") == 4 and
            player:usedSkillTimes(que_zhaohua.name, Player.HistoryGame) == 0
    end,
    can_wake = function(self, event, target, player, data)
        if #player.room.alive_players >= 5 then
            return #player:getTableMark("@que_huanmeng") == 4
        else
            return #player:getTableMark("@que_huanmeng") > 2
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:changeMaxHp(player, -1)
        room:handleAddLoseSkills(player, "-que_huanmeng")
        local suits = { 1, 2, 3, 4 }
        local cards = {}
        local id = -1
        for i = #room.draw_pile, 1, -1 do
            id = room.draw_pile[i]
            if table.removeOne(suits, Fk:getCardById(id).suit) then
                table.insert(cards, id)
            end
        end
        if #cards > 0 then
            room:moveCards({
                ids = cards,
                to = player,
                toArea = Card.PlayerHand,
                moveReason = fk.ReasonJustMove,
                proposer = player,
                skillName = que_zhaohua.name,
                moveVisible = true,
            })
        end
        for _, i in ipairs(cards) do
            room:setCardMark(Fk:getCardById(i), "@@zhaohua", 1)
        end
    end,
})

return que_zhaohua
